

#ifndef __SETTINGS_H
#define __SETTINGS_H

class Settings
{
	const Args &args;

public:

	Settings( const Args & args )
		:	args(args)
	{
		if((GetLoopMinimum() < 1) || (GetLoopMinimum() > GetLoopMaximum()))
			throw Exception("bad loop min / max settings!!!");

		if(GetThreadCount() < 1)
			throw Exception("bad thread count settings!!!");
	}

	virtual ~Settings(){
	}

	int GetThreadCount() const {

		int t = args.GetSettingAsInt("--threads");

		if(t)
			return t;

		return 1;
	}

	int GetLoopMinimum() const {

		int t = args.GetSettingAsInt("--loopmin");

		if(t)
			return t;

		return 1;
	}

	int GetLoopMaximum() const {

		int t = args.GetSettingAsInt("--loopmax");

		if(t)
			return t;

		return 1;
	}

	int ParallelVids() const {

		int t = args.GetSettingAsInt("--parallel");

		if(t>0)
			return t;

		return 1;
	}

	std::string GetVideoDirectory() const {

		std::string str = args.GetSettingAsString("--vids");

		if(str.size() != 0)
			return str;

		return ".\\";
	}

	bool ShowHelpAndQuit() const {

		if(args.GetSwitch("-h") || args.GetSwitch("-?") || args.GetSwitch("--help"))
			return true;

		return false;
	}
};

#endif /*** __SETTINGS_H ***/

